<h3>订单项列表</h3>

<table>
  <tr>
    <th>ID</th>
    <th>产品名</th>
    <th>价格</th>
    <th>数量</th>
    <th>汇总</th>  
  </tr>

<% for item in @order.order_items %>
  <tr>
    <td><%=item.id %></td>
    <td><%=h item.product.name %></td>
    <td><%= number_to_currency(item.price,:unit=>"￥",:precision=>2) %></td>
    <td><%= item.amount %></td>
    <td><%= number_to_currency(item.price*item.amount,:unit=>"￥",:precision=>2) %></td> 
  </tr>
<% end %>
<tr><td colspan="5">总额：<%= number_to_currency(@order.total,:unit=>"￥",:precision=>2) %> </td></tr>
</table>

<br />